package com.esunrising.esungsc.controller;

import com.esunrising.esungsc.entity.TApiKm;
import com.esunrising.esungsc.service.AccountTitleService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/internal/api/v1/accountTitle")
@Api(value = "/internal/api/v1/accountTitle",tags = "科目字典接口处理模块")
@Slf4j
public class AccountTitleController {

    @Resource
    private AccountTitleService accountTitleService;

    @GetMapping("/accountTitleResult")
    public Object accountTitleResult() {
        String code = "44eed987-20ba-4041-86f4-c056acf4ee1e";
        String year = "2024";

        //记录日志的参数
        String dwbh = "";
        String orgCode = "";

       List<TApiKm> tApiKmList = accountTitleService.accountTitleResult(dwbh,orgCode,code,year);
        System.out.println("tApiKmList:"+tApiKmList);

       //存入数据库
        accountTitleService.saveTApiKmList(tApiKmList);
        return  tApiKmList;
    }
}
